﻿using System;
using System.Collections.Generic;
using System.ComponentModel.Composition;
using System.Linq;
using System.Text;

namespace PefStudio.Windows
{
    [Export(MainWindow.MainMenuContract, typeof(IMenuItem))]
    sealed class MainHelpMenus : AbstractMenuItem, IPartImportsSatisfiedNotification
    {
        public const string Contract = "PefStudio.Windows.MainMenu.HelpMenu";

        public MainHelpMenus()
        {
            ID = "Help";
            Text = "&Help";

            InsertRelativeToID = "File";
        }

        [ImportMany(Contract, typeof(IMenuItem), AllowRecomposition = true)]
        private IEnumerable<IMenuItem> MenuItems { get; set; }

        public void OnImportsSatisfied()
        {
            CreateService.CreateMenu(this.DropDownItems, MenuItems, MainWindow);
        }
    }

    [Export(MainHelpMenus.Contract, typeof(IMenuItem))]
    sealed class MainFileMenuExit : AbstractMenuItem
    {
        public MainFileMenuExit()
        {
            ID = "About";
            Text = "&About";
        }

        protected override void OnClick(EventArgs e)
        {
        }
    }
}
